package com.yanqu.road.server.manager.cross.battle.dunhuangshiku;

import com.yanqu.road.entity.activity.dunhuangshiku.DunHuangShiKuHelpRecordData;
import com.yanqu.road.entity.activity.dunhuangshiku.DunHuangShiKuKillLogData;
import com.yanqu.road.entity.activity.dunhuangshiku.DunHuangShiKuUserData;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Description 敦煌石窟玩家信息
 * @Author cwq
 * @Data 2021/4/15 18:01
 */
public class DunHuangShiKuUser {

    public DunHuangShiKuUserData baseInfo = null;

    /**
     * 仇人集合(被其他玩家探索和被标记) 血量有变化需要通知仇人
     */
    private Set<DunHuangShiKuUser> canAttackUserSet = new HashSet<>();

    /**
     * 个人日志
     */
    private List<DunHuangShiKuKillLogData> userLogDataList= null;

    /**
     * 玩家求助记录(包括 击杀和未击杀)
     */
    private Map<Long, DunHuangShiKuHelpRecordData> helpRecordDataMap = null;

    /**
     * 当前正在求助的记录
     */
    public DunHuangShiKuHelpRecordData currentHelpRecordData = null;

    /**
     * 是否在系统内
     */
    public boolean inActivity;

    /**
     * 事件保底值
     */
    public int securityTimes;

    /**
     * 进入第三层的时间 (s)
     */
    public int enterMaxRegionTime;

    public DunHuangShiKuUser(DunHuangShiKuUserData baseInfo) {
        this.baseInfo = baseInfo;
    }

    public Set<DunHuangShiKuUser> getCanAttackUserSet() {
        return canAttackUserSet;
    }

    public List<DunHuangShiKuKillLogData> getUserLogDataList(boolean newIfNull) {
        if(userLogDataList == null && newIfNull){
            userLogDataList = new ArrayList<>();
        }
        return userLogDataList;
    }

    public void setUserLogDataList(List<DunHuangShiKuKillLogData> userLogDataList) {
        this.userLogDataList = userLogDataList;
    }

    public Map<Long, DunHuangShiKuHelpRecordData> getHelpRecordDataMap(boolean newIfNull) {
        if(helpRecordDataMap == null && newIfNull){
            helpRecordDataMap = new ConcurrentHashMap<>();
        }
        return helpRecordDataMap;
    }

}
